package com.sgb.kjwl.api.service;

import com.sgb.kjwl.BuildConfig;
import com.sgb.kjwl.model.entity.LoginEntity;
import com.sgb.kjwl.model.entity.ProListEntity;
import com.sgb.kjwl.model.entity.businessmanagement.CompanyEntity;
import com.sgb.kjwl.model.entity.self.WebsiteDeleteEntity;
import com.sgb.kjwl.model.entity.self.WebsiteDetailEntity;
import com.sgb.kjwl.model.entity.self.WebsitePhotoEntity;
import com.sgb.kjwl.model.entity.self.WebsitePhotoListEntity;
import com.sgb.kjwl.model.entity.self.WebsiteQualityEntity;
import com.sgb.kjwl.model.entity.self.WebsiteTypeEntity;
import com.swgk.core.base.model.entity.ListResponse;
import com.swgk.core.base.model.entity.BaseEntity;
import com.swgk.core.base.model.factory.BaseUrlInterceptor;

import java.util.List;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.Url;

public interface MailListAPI {

    //获取公司名称及logo
    @POST("v1/app/userInfo/getCompanyLogo")
    Call<BaseEntity<CompanyEntity>> getCompanyLogo();

    //我的界面获取账号所有企业
    @POST()
    @Headers("tokenType:pc")
    Call<BaseEntity<List<CompanyEntity>>> getUserCompany(@Url String url);

    //个人基本信息界面获取账号所有企业
    @POST("v1/app/userInfo/getCurrentCompany")
    Call<BaseEntity<List<CompanyEntity>>> getCurrentCompany();

    //个人基本信息界面获取账号所有企业
    @Headers({BaseUrlInterceptor.HEADERS_URL_USER, "tokenType:pc"})
    @GET("v1/app/userInfo/myComList")
    Call<BaseEntity<ListResponse<List<CompanyEntity>>>> getNewCurrentCompany(@Query("limit") String limit, @Query("page") String page);

    //设置主企业接口
    @Headers({BaseUrlInterceptor.HEADERS_URL_USER, "tokenType:pc"})
    @GET("v1/app/site/admin/companyInfo/setMainCompany")
    Call<BaseEntity> setMainCompany(@Query("id") String id, @Query("memberNo") String memberNo);

    //获取此企业下我的信息
    @FormUrlEncoded
    @POST("v1/app/userInfo/getMyInfoByCompanyNo")
    Call<BaseEntity<CompanyEntity>> getMyInfoByCompanyNo(@Field("companyNo") String companyNo);

    //切换企业接口(原设置主企业接口)
    @FormUrlEncoded
    @POST("v1/app/userInfo/settingMainCompany")
    Call<BaseEntity<LoginEntity>> settingMainCompany(@Field("no") String no, @Field("type") int type);

    //获取生成二维码信息
    @POST("v1/app/userInfo/queryGroupQrCode")
    Call<BaseEntity> getGenerateQrCode(@Query("groupId") String teamId);

    @FormUrlEncoded
    @POST("v1/app/userInfo/isAdministrator")
    Call<BaseEntity> isAdministrator(@Field("companyNo") String companyNo);


    //网站管理-查询企业信息
    @FormUrlEncoded
    @POST("v1/app/user/website/queryCompanyInfo")
    Call<BaseEntity<WebsiteDetailEntity>> getWebsiteInfo(@Field("companyNo") String no);

    //网站管理-保存企业信息
    @POST("v1/app/user/website/updateCompanyInfo")
    Call<BaseEntity> saveWebsiteInfo(@Body WebsiteDetailEntity entity);

    //网站管理-获取企业相册列表
    @FormUrlEncoded
    @POST("v1/app/user/website/queryCompanyAlbum")
    Call<BaseEntity<ProListEntity<List<WebsitePhotoEntity>>>> getWebsitePhoto(@Field("companyNo") String id, @Field("pageNum") String pageNum, @Field("pageSize") String pageSize);

    //网站管理-保存企业照片
    @POST("v1/app/user/website/addAlbum")
    Call<BaseEntity> saveWebsitePhoto(@Body WebsitePhotoListEntity en);

    //网站管理-删除企业照片
    @POST("v1/app/user/website/deleteAlbum")
    Call<BaseEntity> deleteWebsitePhoto(@Body WebsiteDeleteEntity en);

    //网站管理-获取企业资质列表
    @FormUrlEncoded
    @POST("v1/app/user/website/queryCompanyQualify")
    Call<BaseEntity<ProListEntity<List<WebsiteQualityEntity>>>> getWebsiteQuality(@Field("companyNo") String id, @Field("pageNum") String pageNum, @Field("pageSize") String pageSize);

    //网站管理-编辑企业资质
    @POST("v1/app/user/website/saveCompanyQualify")
    Call<BaseEntity> editWebsiteQuality(@Body WebsiteQualityEntity en);

    //网站管理-企业资质类型
    @POST("v1/app/user/website/qualifyType")
    Call<BaseEntity<List<WebsiteTypeEntity>>> getWebsiteQualityType();

    //网站管理-删除企业资质
    @FormUrlEncoded
    @POST("v1/app/user/website/deleteCompanyQualify")
    Call<BaseEntity> deleteWebsiteQuality(@Field("id") String id);

    class UserCenterUrl{
        public static final String URL_GET_USER_COMPANY = BuildConfig.BASE_URL_USER + "v1/app/userInfo/getUserCompany";

    }
}
